No Crystal References required
Private Sub Form_Load()
CrystalReport1.ReportFileName = App.Path & "\OCX_to_RDC.rpt"
Change the location of the database.
CrystalReport1.DataFiles(0) = App.Path & "\xtreme.mdb"
Pass the parameter value to the main report.
CrystalReport1.ParameterFields(0) = "Param1;Main Report Param;True"
Pass the selection formula to the main report.
CrystalReport1.ReplaceSelectionFormula _ "{Customer.Last Year's Sales} < 50000.00"
CrystalReport1.SubreportToChange = "Sub1"
Change the location of the database in the subreport.
CrystalReport1.DataFiles(0) = App.Path & "\xtreme.mdb"
Pass the formula to the subreport.
CrystalReport1.Formulas(0) = "Formula1= " & "'Subreport Formula'"
Set CrystalReport1 back to using the main report.
CrystalReport1.SubreportToChange = "" End Sub Private Sub Command1_Click()
Set the destination to window.
CrystalReport1.Destination = crptToWindow
CrystalReport1.Action = 1 End Sub Private Sub Command2_Click()
CrystalReport1.PrinterDriver = "HPPCL5MS.DRV"
CrystalReport1.PrinterName = "HP LaserJet 4m Plus"
CrystalReport1.PrinterPort = "\\Vanprt\v1-1 mpls-t s"
Set the destination to printer.
CrystalReport1.Destination = crptToPrinter
CrystalReport1.Action = 1 End Sub Private Sub Command3_Click()
Set the Report to be exported to Rich Text Format.
CrystalReport1.PrintFileType = crptRTF
CrystalReport1.Destination = crptToFile
Set the path and name of the exported document.
CrystalReport1.PrintFileName = App.Path & "\OCXExport.rtf"
CrystalReport1.Action = 1 End Sub
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |